package com.stox.charting.ui.swing.presenter.delegate.builder;

import com.stox.charting.ui.swing.model.price.PriceChartView;
import com.stox.charting.ui.swing.view.ChartView;
import com.stox.charting.ui.swing.view.ChartingInternalFrameView;
import com.stox.core.model.IBar;
import com.stox.ioc.SmartContainer;

public class ChartingInternalFrameViewBuilder {

	private ChartViewBuilder chartViewBuilder;
	
	public <T extends IBar> ChartingInternalFrameView build(){
		ChartingInternalFrameView chartingInternalFrameView = SmartContainer.instance().getPrototype(ChartingInternalFrameView.class);
		PriceChartView priceChartView = (PriceChartView)chartViewBuilder.build(ChartView.Type.PRICE, chartingInternalFrameView);
		chartingInternalFrameView.setPriceChartView(priceChartView);
		return chartingInternalFrameView;
	}

	public ChartViewBuilder getChartViewBuilder() {
		return chartViewBuilder;
	}

	public void setChartViewBuilder(ChartViewBuilder chartViewBuilder) {
		this.chartViewBuilder = chartViewBuilder;
	}

}
